import select, socket

port = 5000
bufferSize = 1024
s = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
s.bind(('localhost', port))
s.setblocking(0)

while True:
    result = select.select([s], [], [])
    msg = result[0][0].recv(bufferSize)
    print msg
